import http from '../utils/request'

export const addTask = (data) => {
    return http({
        'url': "/api/task/addTask",
        'method': 'post',
        'data': data
    })
}

export const selectTaskOfProject = () => {
    return http({
        'url': "/api/project/selectTaskOfProject",
        'method': 'get'
    })
}

export const selectTaskById = (id) => {
    return http({
        'url': `/api/task/selectTaskById/${id}`,
        'method': 'get',
    })
}

export const updateTaskById = (params) => {
    return http({
        'url': "/api/task/updateTaskById",
        'method': 'put',
        'data': params
    })
}

export const selectTaskPages = (params) => {
    return http({
        'url': '/api/task/page',
        'method': 'get',
        'params': params
    })
}

export const updateStatusById = (id) => {
    return http({
        'url': `/api/task/updateStatusById/${id}`,
        'method': 'put'
    })
}

export const deleteTaskById = (id) => {
    return http({
        'url': `/api/task/deleteTaskById/${id}`,
        'method': 'delete'
    })
}

export const selectStatusOfTasks = () => {
    return http({
        'url':"/api/task/selectStatusOfTasks",
        'method':'get'
    })
}